// 登录模块
import { makeAutoObservable } from "mobx";
import { http, setToken, getToken, clearToken, } from "@/utils";

class LoginStore {
  token = getToken() || "";

  constructor() {
    makeAutoObservable(this);
  }

  login = async (form) => {
    const res = await http({
      url: `/login/`,
      method: "post",
      data: form
    });
    console.log(res);
    setToken(res.token);
    return res;

  };
}

export default LoginStore;
